package com.hellobike.haxing.modules.shop.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import com.hellobike.haxing.modules.shop.entity.ShopWithdrew;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * @Description: 提现申请
 * @Author: haxing-boot
 * @Date:   2020-02-08
 * @Version: V1.0
 */
public interface ShopWithdrewMapper extends BaseMapper<ShopWithdrew> {
    /**
     * 批量审核通过
     * @param ids
     * @param auditUser
     */
    void approveBatch(@Param("ids") List<Long> ids,@Param("auditUser") String auditUser);

    /**
     * 批量打款
     * @param ids
     * @param loanUser
     */
    void loanBatch(@Param("ids") List<Long> ids,@Param("loanUser") String loanUser);

    /**
     * 删除
     * @param id
     * @param userId
     */
    @Update("update t_shop_withdrew set deleted=1,update_by=#{userId},update_time=now() where id=#{id} and status in (3,4)")
    void deleteWithdrew(@Param("id") Long id,@Param("userId") Integer userId);

    /**
     * 批量删除
     * @param ids
     * @param userId
     */
    void deleteBatch(@Param("ids")List<Long> ids,@Param("userId") Integer userId);

    /**
     * 运营批量审核通过
     * @param ids
     * @param auditUser
     */
    void yyapproveBatch(@Param("ids") List<Long> ids,@Param("auditUser") String auditUser);

    /**
     * 查询用户guid
     * @param shopId
     * @return
     */
    @Select("select u.guid from t_shop t,t_user u where t.user_id=u.id and t.id=#{shopId}")
    String getUserGuid(Long shopId);
}
